package com.pig4cloud.pig.propertyroom.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.pig.propertyroom.entity.PropertyRoom;
import com.pig4cloud.pig.propertyroom.mapper.RoomMapper;
import com.pig4cloud.pig.propertyroom.service.RoomService;
import com.pig4cloud.pig.resident.feign.entity.Resident;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoomServiceImpl extends ServiceImpl<RoomMapper, PropertyRoom> implements RoomService {
	@Autowired
	private RoomMapper roomMapper;
	@Override
	public PropertyRoom getByFloorIdAndRoomNumber(Long floorId, String roomNumber) {
		return roomMapper.getByFloorIdAndRoomNumber(floorId, roomNumber);
	}

	@Override
	public Resident[] selectResidentByRoomId(Long[] ids) {
		return roomMapper.selectResidentByRoomId(ids);
	}

	@Override
	public PropertyRoom checkRoomByNumber(PropertyRoom roomEntity) {
		return roomMapper.checkRoomByNumber(roomEntity);
	}

	@Override
	public PropertyRoom getByRoomId(Long roomId) {
		return roomMapper.getByRoomId(roomId);
	}

}
